﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SoccerEvaluator.Common
{
    /// <summary>
    /// 
    /// </summary>
    public class SystemUserInfo
    {
        /// <summary>
        /// 
        /// </summary>
        public int UserId
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Username
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public string Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime RegistryDate
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public DateTime LastAccess
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public string Email
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Password
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public int Total
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public int ExactScore
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public int CatchScore
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="r1"></param>
        /// <param name="r2"></param>
        /// <returns></returns>
        public static int CompareTotal(SystemUserInfo r1, SystemUserInfo r2)
        {
            int totalScore = r2.Total.CompareTo(r1.Total);

            int exactScore = r2.ExactScore.CompareTo(r1.ExactScore);

            int catchScore = r2.CatchScore.CompareTo(r1.CatchScore);

            int nameDiff = r1.Name.CompareTo(r2.Name);

            //return totalScore + exactScore;

            //Comparador ponderado
            return 7 * totalScore + 2 * exactScore + nameDiff;
        }
    }
}
